package com.sctvcloud.qingchuan.ui.adapter.holder;

import android.content.Context;
import android.view.View;

import com.sctvcloud.qingchuan.R;
import com.sctvcloud.qingchuan.beans.HomeListItem;

import butterknife.ButterKnife;
import butterknife.OnClick;

public class AttentionEntryHolder extends BaseAbsHolder<HomeListItem> {


    private OnAttentionEntryClickListener entryClickListener;

    public AttentionEntryHolder(Context context, View itemView, OnAttentionEntryClickListener listener) {
        super(context, itemView);
        this.entryClickListener = listener;
    }

    @Override
    public void setData(HomeListItem newsItem) {

    }

    @Override
    protected void initInject() {
        ButterKnife.bind(this, itemView);
    }

    @OnClick(value = {R.id.mine_attention_layout, R.id.mine_more_layout})
    public void onClick(View view) {
        if (null != entryClickListener) {
            if (view.getId() == R.id.mine_attention_layout) {
                entryClickListener.OnEntryClick(1);
            } else if (view.getId() == R.id.mine_more_layout) {
                entryClickListener.OnEntryClick(2);
            }
        }
    }

    public void setEntryClickListener(OnAttentionEntryClickListener entryClickListener) {
        this.entryClickListener = entryClickListener;
    }

    public interface OnAttentionEntryClickListener {
        void OnEntryClick(int clickPosition);
    }
}
